from google.appengine.ext import db

class SolarArray(db.Model):
  owner = db.StringProperty()
  tz = db.StringProperty()
  
class SolarData(db.Model):
  system = db.ReferenceProperty(SolarArray, required = True)
  date = db.DateTimeProperty(auto_now_add=True)
  watts = db.IntegerProperty()
  kwhToday = db.FloatProperty()
  kwhLifetime = db.FloatProperty()
  
class SolarDay(db.Model):
  system = db.ReferenceProperty(SolarArray)
  date = db.DateProperty()
  kwhToday = db.FloatProperty()
  kwhNow = db.FloatProperty()
  kwhNowBase = db.TimeProperty()
  
class SolarAggregate(db.Model):
  system = db.ReferenceProperty(SolarArray, required = True)
  date = db.DateTimeProperty(required = True)
  length = db.IntegerProperty()
  watts = db.IntegerProperty()
  maxWatts = db.IntegerProperty()
  kwhToday = db.FloatProperty()
  points = db.IntegerProperty()
  
  
  
  